using System.Text;
using System.Text.Json;

namespace Vin.Tool.Core.StreamCategory;

public static partial class Extension
{
    public static Task<string> ReadToString(this Stream stream, Encoding? encoding = null)
    {
        return StreamTool.ReadToString(stream, encoding);
    }

    public static Task<JsonElement?> ReadToJson(this Stream stream, Encoding? encoding = null)
    {
        return StreamTool.ReadToJson(stream, encoding);
    }

    public static Task<T?> ReadToJson<T>(this Stream stream, Encoding? encoding = null)
    {
        return StreamTool.ReadToJson<T>(stream, encoding);
    }
}